<template>
	<view class="class_item" @click="onClassDetail(item)">
		<image :src="item.img" mode="aspectFill"></image>
		<view class="class_name_box">
			<text class="tag">{{item.typeStr}}</text>
			<view class="class_name">{{item.name}}</view>
		</view>
		<view class="author_name">{{item.anchorIntroduction}} {{item.anchorName}}</view>
	</view>
</template>

<script>
	export default {
		props: {
			item: {
				type: Object,
				default: function() {
					return {};
				}
			},
			index: {
				type: Number,
				default: function() {
					return 0;
				}
			}
		},
		methods: {
			onPageJump(url) {
				uni.navigateTo({
					url: url
				});
			},
			onClassDetail(item) {
				if (item.type) {
					uni.navigateTo({
						url: '/pages/businessSchool/classDetail?type=1000&id=' + item.objId
					});
				} else {
					uni.navigateTo({
						url: '/pages/businessSchool/classDetail?type=2000&id=' + item.objId
					});
				}
			}
		}
	};
</script>

<style lang="scss" scoped>
	@import '@/style/mixin.scss';

	.class_item {
		height: 290rpx;
		width: 330rpx;
		margin-top: 32rpx;

		image {
			width: 330rpx;
			height: 186rpx;
			background-color: #dadada;
			border-radius: 8rpx;
		}

		.class_name_box {
			font-size: 24rpx;
			display: flex;
			align-items: center;
			margin-top: 24rpx;

			.tag {
				height: 37rpx;
				border-radius: 8rpx;
				border: solid 1rpx $themeColor;
				padding: 0 8rpx;
				color: $themeColor;
				flex-shrink: 0;
			}

			.class_name {
				font-size: 28rpx;
				margin-left: 12rpx;
				font-weight: bold;
				@include bov(1);
			}
		}

		.author_name {
			margin-top: 12rpx;
			font-size: 24rpx;
			color: #999999;
			@include bov(1);
		}

	}
</style>
